package design.principles.lsp.before;

public class Client {
    public static void main(String[] args) {
        calculateRectangleArea(new Rectangle());
        calculateRectangleArea(new Square());
    }

    static void calculateRectangleArea(Rectangle rectangle) {
        rectangle.setWidth(4);
        rectangle.setLength(5);
        if (rectangle.getWidth() * rectangle.getLength() == 20) {
            System.out.println("Area is correct.");
        } else {
            throw new RuntimeException("Wrong area!!!");
        }
    }
}
